

IF NOT EXISTS(SELECT * FROM sys.databases  WHERE database_id = DB_id(N'PerformanceTest'))
	CREATE DATABASE PerformanceTest
GO
USE PerformanceTest
GO
IF EXISTS(SELECT * FROM sys.objects  WHERE [object_id]=OBJECT_ID(N'Request'))
	DROP TABLE Request
GO
CREATE TABLE Request
(
	RequestID	INT IDENTITY(1,1),
	ProcessId	int,
	URL			NVARCHAR(2000),
	Location	NVARCHAR(100),
	GatewayDeterminationTime int,
	DNSTime					int,
	TCPConnectTime			int,
	HTTPSHandshake			int,
	ElapsedTime				INT,
	RequestTime				DATETIME,
	RequestTimeFormat		datetime,
	ClientTime				int,
	NetworkTime				int,
	ServerTime				int,
	ClientConnected			datetime,
    ClientBeginRequest		datetime,
    GotRequestHeaders		datetime,
    ClientDoneRequest		datetime,
    ServerConnected			datetime,
    ServerGotRequest		datetime,
    ServerBeginResponse		datetime,
    GotResponseHeaders		datetime,
    ServerDoneResponse		datetime,
    ClientBeginResponse		datetime,
    ClientDoneResponse		datetime
	CONSTRAINT PK_Request PRIMARY KEY 
	(RequestID)
)
IF EXISTS(SELECT * FROM sys.objects  WHERE [object_id]=OBJECT_ID(N'WordMonitor'))
	DROP TABLE WordMonitor
GO
CREATE TABLE WordMonitor
(
	WordMonitorID	INT IDENTITY(1,1),
	FileName			NVARCHAR(500),
	Location	NVARCHAR(100),
	LoadAppTime	 float,
	LoadTemplateTime					float,
	WriteTime			float,
	SaveTime float,
	CloseTime float,
	StartTime datetime,
	EndTime datetime,
	StartTimeFormat datetime
	CONSTRAINT PK_WordMonitor PRIMARY KEY 
	(WordMonitorID)
)

IF EXISTS(SELECT * FROM sys.objects  WHERE [object_id]=OBJECT_ID(N'HtmlAction'))
	DROP TABLE HtmlAction
GO
CREATE TABLE HtmlAction
(
	ActionID	INT IDENTITY(1,1),
	BeginTime			DATETIME,
	EndTime				DATETIME,
	ElapsedTime	 int,
	BeginTimeFormat		DATETIME,
	Location			NVARCHAR(100),
	Url					NVARCHAR(2000),
	Scenario			int,
	CONSTRAINT PK_HtmlAction PRIMARY KEY 
	(ActionID)
)


